// src/router/index.js
import {createRouter, createWebHistory} from 'vue-router';


import HomeView from '../views/HomeView.vue'
/*const routes = [
  { path: '/', component: () => import('../views/LoginView')},
  { path: '/resource', component: () => import('../views/ResourceView.vue')}
];*/

const routes = [
    {
        path: '/',
        name: 'home',
        component: HomeView,
        redirect: '/user',
        children: [
            {path: '/user', component: () => import('../views/user/UserView.vue')},
            {path: '/order', component: () => import('../views/order/OrderView.vue')},
            {path: '/order/myPackage', component: () => import('../views/order/myPackage.vue')},
            {path: '/order/itemsDetails', component: () => import('../views/order/itemsDetails.vue')},
            {path: '/order/returnAfterSale', component: () => import('../views/order/returnAfterSale.vue')},
            {path: '/funt', component: () => import('../views/funt/FuntView.vue')}
        ]
    },
    {path: '/login', component: () => import('../views/LoginView')},
    {path: '/resource', component: () => import('../views/ResourceView.vue')}
]

const router = createRouter({
    history: createWebHistory(process.env.BASE_URL),
    routes
})

export default router